How to create array in php ?

Use array() as :-

array(
  'key1'=>'value1',
  'key2'=>'value2',
  'key3'=>'value3',
  )

Q. How to print array in php ?
A. use
    a) print_r()
    b) var_export()

Q. How to get value from any array ?
A.
  $states = array(
          'up'=>'Uttar Pradesh',
          'mp'=>'Madhya Pradesh',
          'mh'=>'Maharashtra',
          'bh'=>'Bihar');

  --> How do you print "Bihar"
  Ans : echo $states['bh'];

Q. Types of array?
A. 1) Linear (key as int and value as int/string)
   2) Associative Array
      (key as string value as int/string)
Note : array is by default linear.

    $array = array(1,2,3,4,5,6);// Linear array
    $states = array(
          'up'=>'Uttar Pradesh',
          'mp'=>'Madhya Pradesh',
          'mh'=>'Maharashtra',
          'bh'=>'Bihar'); // Associtive array

Q. How many dimentions we can create for any array ?
A. Array may be N Dim.
   Ex: $array['country']; // 1 dim
       $array['country']['state'];// 2 dim
       $array['country']['state']['city'];// 3 dim
